package com.wxy.livebroadcast.service;

import org.springframework.stereotype.Service;

import java.util.concurrent.CopyOnWriteArraySet;

@Service
public class SocketService {

    private static CopyOnWriteArraySet<String> nameSet = new CopyOnWriteArraySet<String>();

    public static CopyOnWriteArraySet<String> getNames(){
        return nameSet;
    }

    public boolean checkSocket(String name){
        return nameSet.add(name);
    }

    public boolean removeSocket(String name){
        return nameSet.remove(name);
    }
}
